#ifndef __OgreURLDemo_H__
#define __OgreURLDemo_H__
#pragma once

#include <OgreURLPrerequisites.h>
#include <OgreWindowEventUtilities.h>
#include <OgreFrameListener.h>

namespace OgreURLDemo
{
	// Per-class allocator
	typedef Ogre::GeneralAllocatedObject ApplicationAlloc;

	/**
	 * @The demo application class.
	 */
	class Application : protected Ogre::WindowEventListener, public Ogre::FrameListener,
		public ApplicationAlloc
	{
	public:
		/**
		 * @brief Default constructor
		 */
		Application();

		/**
		 * @brief Defaut destructor
		 */
		~Application();

		/**
		 * @brief Starting demo
		 */
		void go();

	protected:
		/**
		 * @brief Sets up the application - returns false if the user chooses to abandon configuration.
		 */
		bool setup();

		/**
		 * @brief Setting up rources
		 */
		void setupResources();

		/**
		 * @brief Creating scene entities
		 */
		void createScene();

		/**
		 * @brief Overridden from Ogre::WindowEventListener
		 * @copydoc Ogre::WindowEventListener::windowClosed
		 */
		void windowClosed( Ogre::RenderWindow* rw );

		/**
		 * @brief Overridden from Ogre::FrameListener
		 * @copydoc Ogre::WindowEventListener::frameStarted
		 */
		bool frameStarted( const Ogre::FrameEvent& evt );

		/**
		 * @brief Overridden from Ogre::WindowEventListener
		 * @copydoc Ogre::WindowEventListener::windowResized
		 */
		void windowResized( Ogre::RenderWindow* rw );

	protected:
		/// The instance of Ogre root
		Ogre::Root* mRoot;
		/// The main render window
		Ogre::RenderWindow* mWindow;
		/// The scene manager instance
		Ogre::SceneManager* mSceneMgr;
		/// The default camera
		Ogre::Camera* mCamera;
		/// The parent node for all objects
		Ogre::SceneNode* mObjectsNode; 
	};

} // end of namespace OgreURLDemo


#endif // include guard, end of #ifndef __OgreURLDemo_H__
